package com.ssy.lingxi.report.entity.settleaccount;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 *  会员订单结算DO
 * @author ds
 * @version 2.0.0
 * @date 2021/3/30 14:06
 */
@Data
@Entity
@Table(schema = "public", name = "sa_member_order_settlement",
        indexes = {@Index(name = "sa_member_order_settlement_id_idx", columnList = "settlementId"),
                @Index(name = "sa_member_order_settlement_order_time_idx", columnList = "orderTime")})
public class MemberOrderSettlementDO implements Serializable {

    private static final long serialVersionUID = 532138105954860957L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_order_settlement_seq")
    @SequenceGenerator(sequenceName = "sa_member_order_settlement_seq", name = "member_order_settlement_seq", allocationSize = 1)
    private Long id;

    /**
     * 结算id
     */
    @Column(columnDefinition = "int8")
    private Long settlementId;

    /**
     * 单据号
     */
    @Column(columnDefinition = "varchar(50)")
    private String orderNo;

    /**
     * 单据摘要
     */
    @Column(columnDefinition = "varchar(50)")
    private String orderAbstract;

    /**
     * 单据类型：1-订单，2-退货申请单
     */
    @Column(columnDefinition = "int2")
    private Integer orderType;

    /**
     * 订单类型：1.询价采购 2.需求采购 3.现货采购 4.集采   5.渠道直采 6.渠道现货 7.积分兑换 8.渠道积分兑换
     */
    @Column(columnDefinition = "int2")
    private Integer type;

    /**
     * 单据时间
     */
    @Column(columnDefinition = "int8")
    private Long orderTime;

    /**
     * 订单金额
     */
    @Column(columnDefinition = "decimal")
    private Double orderAmount;

    /**
     * 支付次数
     */
    @Column(columnDefinition = "int2")
    private Integer payCount;
    /**
     * 支付金额
     */
    @Column(columnDefinition = "decimal")
    private Double payAmount;
    /**
     * 支付时间
     */
    @Column(columnDefinition = "int8")
    private Long payTime;

    /**
     * 结算金额
     */
    @Column(columnDefinition = "decimal")
    private Double settlementAmount;

    /**
     * 结算会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 结算角色id
     */
    @Column(columnDefinition = "int8")
    private Long roleId;

    /**
     * 付款会员id
     */
    @Column(columnDefinition = "int8")
    private Long payMemberId;

    /**
     * 付款角色id
     */
    @Column(columnDefinition = "int8")
    private Long payRoleId;

    /**
     * 关联数据id
     */
    @Column(columnDefinition = "int8 default 0")
    private Long dataId;

    /**
     * 是否含税：CommonBooleanEnum
     */
    @Column(columnDefinition = "int")
    private Integer isHasTax;

    /**
     * 税率
     */
    @Column(columnDefinition = "decimal")
    private Double taxRate;

}
